﻿using HengWang.OA.Bll;
using HengWang.OA.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace HengWang.OA.Web.Controllers
{
    public class BaseController : Controller
    {
        //
        // GET: /Base/
        protected override void OnResultExecuting(ResultExecutingContext filterContext)
        {
            Session["admin"] = new StaffInfoBll().Single(u => u.Name == "admin");
            if (Session["admin"]==null)
            {
                filterContext.HttpContext.Response.Redirect("/Admin/Login");
            }
            base.OnResultExecuting(filterContext);
        }

    }
}
